package demo.util;

import java.awt.Toolkit;
import java.awt.Window;

public class SwingUtil {
	
	public static void setWindowCenter(Window window) {
		
		int width = Toolkit.getDefaultToolkit().getScreenSize().width;
		int height = Toolkit.getDefaultToolkit().getScreenSize().height;
		
		
		window.setLocation((width - window.getWidth()) / 2, (height - window.getHeight()) / 2);
	}
}
